<#assign module="zhuanche"/>
<@override name="header">

<link rel="stylesheet" href="${ctx}/assets/css/bootstrap-switch.min.css">
<link rel="stylesheet" href="${ctx}/assets/css/uploadify.css">
<link rel="stylesheet" href="${ctx}/assets/css/datetimepicker.css">
<link href="${ctx}/assets/css/fileinput.css" media="all" rel="stylesheet" type="text/css" />

<style>
    /* autocomplete */
    div.ac {border: 1px solid #ccc;position:absolute;display: none;overflow: auto;background-color: #ffffff;z-index:3000;}
    div.ac > ul {margin-top:10px;padding:0;}
    div.ac > ul > li {height:33px;line-height:33px;cursor:pointer;}
    div.ac > ul > li:hover{background:#eee;}
    div.ac > ul > li > div span {padding-left:15px;}
    div.ac > ul > li > div span em {color:red;font-style: normal;}
</style>
</@override>
<@override name="body">
<div class="tabbable tabs-left">
    <div class="row">
        <div class="col-xs-12">
            <div class="orders-navt">
                <ul class="orders-nav">
					<@shiro.hasPermission name='zhuanCar'>
                        <li class="orders-click"><a data-toggle="tab" href="${ctx}/zhuanche/cars" class="orders-click-a">车辆</a></li>
					</@shiro.hasPermission>
					<@shiro.hasPermission name='zhuanCar'>
                        <li><a  href="${ctx}/zhuanche/carTypes" >类型</a></li>
					</@shiro.hasPermission>
                </ul>
            </div>
            <div class="orders-navh">

                <div class="btn-group">
                    <a href="#" data-value="20" type="button" style="height: 33px;line-height: 33px;margin-left: 30px;font-size: 17px;width: 70px;" class="btn btn-primary btn-xs importCar">导入</a>
                    <a href="#" data-value="20" type="button" style="height: 33px;line-height: 33px;margin-left: 30px;font-size: 17px;" class="btn btn-primary btn-xs addCar">添加车辆</a>
                    <@jgpt>
                    <button type="button" class="btn btn-primary btn-xs dropdown-toggle" style="height: 33px;" data-toggle="dropdown" aria-expanded="false">
                        <span class="caret"></span><span class="sr-only">Toggle Dropdown</span></button>
                    <ul class="dropdown-menu" role="menu" style='margin-left: 130px;min-width: 0px'>
                        <li style="cursor:pointer;">
                            <a href="#" data-value="20" class="btn-link report">上报车辆</a>
                        </li>
                        <!--<li style="cursor:pointer;">
                            <a href="#" data-value="20" class="btn-link importCar">导入</a>
                        </li>-->
                    </ul>
                    </@jgpt>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="tab-content">
    <div class="container-fluid ">
        <div class="row query-pad">
            <div class="col-xs-11" style="padding: 0px;">
				<#assign isMainCompany="false">
				<@shiro.isMainCompany>
					<#assign isMainCompany="true">
                    <div class="col-xs-4 input-query">
                        <span>所属公司:</span>
                        <input type="text" class="form-control form-contb" id="companyName1" name="companyName1" placeholder="请输入公司名字"/>
                    </div>
				</@shiro.isMainCompany>
                <div class="col-xs-4 input-query">
                    <span>汽车类型:</span>
                    <input type="text" class="form-control form-contb" id="carType1" name="carType1" placeholder="请输入汽车类型"/>
                </div>
                <div class="col-xs-4 input-query">
                    <span>电话或工号:</span>
                    <input type="text" class="form-control form-contb" id="employName1" name="employName1" placeholder="请输入员工电话或工号"/>
                </div>
            </div>
            <div class="col-xs-1"style="padding: 0px;">
                <div class="input-query-bttom">
                    <button id="searchButton" type="button">查询</button>
                </div>
            </div>
        </div>
        <div class="row query-pad choose" style="display: none;">
            <div class="col-xs-12" style="padding:0px; line-height:3;">
                <div class="col-xs-4">
                    <div class="input-query " style="padding:0px; line-height:3;">
                        <span>车牌号:</span>
                        <input type="text" class="form-control form-contb" id="carNumber1" name="carNumber1" placeholder="请输入车牌号"/>
                    </div>
                </div>
                <div class="media-wit melect col-xs-4" style="padding:15px; line-height:3;">
                    <span>车辆状态:</span>
                    <input type="checkbox"  name="status" value="0">
                    <span class="checkbox-margin">空闲</span>
                    <input type="checkbox" name="status" value="1">
                    <span class="checkbox-margin">忙碌</span>
                    <input type="checkbox" name="status" value="2">
                    <span class="checkbox-margin">离线</span>
                </div>
                <@jgpt>
                <div class="media-wit melect col-xs-4" style="padding:15px; line-height:3;">
                    <span>是否已上传监管平台:</span>
                    <input type="checkbox"  name="isPlatform" value="1">
                    <span class="checkbox-margin">已上传</span>
                    <input type="checkbox" name="isPlatform" value="0">
                    <span class="checkbox-margin">未上传</span>
                </div>
				</@jgpt>
            </div>
        </div>
        <div class="query-jiant">
            <a href="#"><img id="jiant" src="${ctx}/assets/img/jiant2.png" /></a>
        </div>
    </div>
</div>

<!--列表-->
<div class="tabta-content">
    <table class="table table-condensed table-striped">
        <tbody id="car_tbody">
        <tr>
        <tr>
        	<@jgpt>
            <th width="20px;">
                <div class='checkbox checkbox-success' id="checkAll"  style='margin-top:-5px;margin-left: 40px;'>
                    <input id='all' class='styled' val="false" type='checkbox' />
                    <label for="all"></label>
                </div>
            </th>
            </@jgpt>
            <th>状态</th>
            <@jgpt>
            <th>是否已上传</th>
            </@jgpt>
            <th>车牌号</th>
            <th>车辆名称</th>
			<@shiro.isMainCompany>
                <th>所属公司</th>
			</@shiro.isMainCompany>
            <th>车辆类型</th>
            <th>驾驶员工</th>
            <th>限行时间</th>
            <th>年检到期时间</th>
            <th>已行驶里程(km)</th>
            <th>所在地</th>
            <th>操作</th>
        </tr>
        </tr>
        </tbody>
    </table>

    <ul class="pagination pull-left pagination-sm pageshow" style="display:none;">
        <li><a></a></li>
    </ul>
    <ul class="pagination pull-left pagination-sm pagedata" style="display:none;">
    </ul>
</div>



<!--添加车辆-->
<div class="form-horizontal" >
    <div class="modal fade" id="dialog_car"  data-backdrop="static">
        <div class="modal-dialog" style="width:680px;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="false">&times;</button>
                    <h4 class="modal-title">添加车辆</h4>
                </div>
                <div class="modal-body">
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#basicInfo" data-toggle="tab">基本信息</a></li>
                        <li><a href="#overhaulTab" data-toggle="tab">年检信息</a></li>
                        <li><a href="#insuranceTab" data-toggle="tab">保险信息</a></li>
                        <li><a href="#detailedTab" data-toggle="tab">详细信息</a></li>
                        <li><a href="#taxiTab" data-toggle="tab">经营信息</a></li>
                        <li><a href="#deviceTab" data-toggle="tab">定位信息</a></li>
                        <li><a href="#imageTab" data-toggle="tab">车辆照片</a></li>
                        <li><a href="#plateImageTab" data-toggle="tab">车牌照片</a></li>
                    </ul>
                    <form id="submit_form" action="" method="post" class="form-horizontal">
                        <input type="hidden" id="employId" name="employId">
                        <div class="tab-content">
                            <div class="tab-pane in active" id="basicInfo">
                                <div class="panel margin-top">
                                    <div class="panel-body" style="margin-left:0px">
										<@shiro.isMainCompany>
                                            <input type="hidden" id="companyName" name="companyName">
                                            <div class="form-group">
                                                <label class="col-sm-3 control-label"><em>*</em>&ensp;所属公司：</label>
                                                <div class="col-sm-9">
                                                    <select class="form-control" id="companyId" name="companyId">
														<#if companys??>
                                                            <option value="">请选择公司</option>
															<#list companys as company>
                                                                <option  value="${company.id}" <#if companyId?? && companyId==company.id>selected="selected"</#if>>${company.abbreviation?if_exists}</option>
															</#list>
														</#if>
                                                    </select>
                                                </div>
                                            </div>
										</@shiro.isMainCompany>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label"><em>*</em>&ensp;车辆名称：</label>
                                            <div class="col-sm-9">
                                                <input id="carName" name="carName" class="form-control" ></input>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label"><em>*</em>&ensp;车牌号码：</label>
                                            <div class="col-sm-9">
                                                <input id="carNumber" name="carNumber" class="form-control" placeholder="如:京A12345"></input>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label"><em>*</em>&ensp;车辆类型：</label>
                                            <div class="col-sm-9">
                                                <select class="form-control" id="carTypeId" name="carTypeId">
													<#if carTypes??>
														<#list carTypes as carType>
                                                            <option value="${carType.id}">${carType.typeName?if_exists}</option>
														</#list>
													</#if>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label"><em>*</em>&ensp;行驶里程：</label>
                                            <div class="col-sm-9">
                                                <div class="input-group">
                                                    <input id="drivingDistance" name="drivingDistance" type="text" class="form-control" >
                                                    <span class="input-group-addon">公里</span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label"><em>*</em>&ensp;是否限行：</label>
                                            <div class="col-sm-9">
                                                <select class="form-control" id="limitLine" name="limitLine" >
                                                    <option value="0">不限行</option>
                                                    <option value="1">星期一</option>
                                                    <option value="2">星期二</option>
                                                    <option value="3">星期三</option>
                                                    <option value="4">星期四</option>
                                                    <option value="5">星期五</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label"><em>*</em>&ensp;购车日期：</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="buyTime" name="buyTime" type="text"  readonly/>
                                            </div>
                                        </div>
                                        <div class="form-group">
							                <label class="col-sm-3 control-label">&ensp;倒班班次：</label>
							                <div class="col-sm-9">
							                   	<input id="flights2" name="flights" class="form-control" placeholder="如:早，中，晚，白（非必填）"></input>
							                </div>
										</div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">指派员工：</label>
                                            <div id="text_div" class="col-sm-9">
                                                <input class="form-control" id="employName" name="employName" placeholder="输入:工号、电话、姓名"  type="text"/>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="tab-pane in" id="insuranceTab">
                                <div class="panel margin-top">
                                    <div class="panel-body">
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label"><em>*</em>&ensp;保险到期日期：</label>
                                            <div class="col-sm-8">
                                                <input class="form-control" id="insuranceTime" name="insuranceTime" type="text"  readonly/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label">保险公司：</label>
                                            <div class="col-sm-8">
                                                <input class="form-control" id="insurer" name="insurer" type="text"/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label">保险号：</label>
                                            <div class="col-sm-8">
                                                <input class="form-control" id="insuranceNo" name="insuranceNo" type="text"/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label">保险类型：</label>
                                            <div class="col-sm-8">
                                                <input class="form-control" id="insType" name="insType" type="text"/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label">保险金额：</label>
                                            <div class="col-sm-8">
                                                <input class="form-control" id="insMoney" name="insMoney" type="text"/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label">保险生效日期：</label>
                                            <div class="col-sm-8">
                                                <input class="form-control" id="insValidTime" name="insValidTime" type="text"  readonly/>
                                            </div>
                                        </div>

                                    </div>
                                </div>
                            </div>

                            <div class="tab-pane in" id="overhaulTab">
                                <div class="panel margin-top">
                                    <div class="panel-body">
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label"><em>*</em>下次年检日期：</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="overhaulTime" name="overhaulTime" type="text"  readonly/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">年度审验状态：</label>
                                            <div class="col-sm-9">
                                                <input type="radio" name="inspectioStatus" value="0" checked="checked"/>已审验
                                                <input type="radio" name="inspectioStatus" value="1" />未审验
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">车辆检修状态：</label>
                                            <div class="col-sm-9">
                                                <input type="radio" name="maintenanceStatus" value="0" checked="checked"/>已检修
                                                <input type="radio" name="maintenanceStatus" value="1" />未检修
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="tab-pane in" id="detailedTab">
                                <div class="panel margin-top">
                                    <div class="panel-body">
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">车牌颜色：</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="plateColor" name="plateColor" type="text" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">车辆厂牌：</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="brand" name="brand" type="text" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">车辆类型：</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="vehicleType" name="vehicleType" type="text" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">车辆型号：</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="vehicleModel" name="vehicleModel" type="text" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">所属车主：</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="owner" name="owner" type="text" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">车辆归属：</label>
                                            <div class="col-sm-9">
                                                <select class="form-control" id="driverProType" name="driverProType" >
                                                    <option value="GR">个人私家车</option>
                                                    <option value="ZY" >平台自有车</option>
                                                    <option value="CZ">出租企业</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">车身颜色：</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="bodyColor" name="bodyColor" type="text" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">发动机号：</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="engineNo" name="engineNo" type="text" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">车辆识别VIN：</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="vin" name="vin" type="text" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">燃料类型：</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="fuel" name="fuel" type="text" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">核定载客：</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="permitted" name="permitted" type="number" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">车辆注册日期：</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="registrationTime" name="registrationTime" type="text" readonly/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">车辆排量：</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="displacement" name="displacement" type="text" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">车辆地址：</label>
                                            <div class="col-sm-3">
                                                <select id="provincial" class="form-control"  name="provincial"></select>
                                            </div>
                                            <div class="col-sm-3">
                                                <select id="city" class="form-control" name="city"></select>
                                            </div>
                                            <div class="col-sm-3">
                                                <select id="county" class="form-control" name="county"></select>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">详细地址：</label>
                                            <div class="col-sm-9">
                                                <input type="text" class="form-control" id="address" name="address">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="tab-pane in" id="taxiTab">
                                <div class="panel margin-top">
                                    <div class="panel-body">
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label">运输证发证机构：</label>
                                            <div class="col-sm-8">
                                                <input class="form-control" id="taxiAgency" name="taxiAgency" type="text" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label">运输证经营区域：</label>
                                            <div class="col-sm-8">
                                                <input class="form-control" id="taxiRegion" name="taxiRegion" type="text" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label">运输证编号：</label>
                                            <div class="col-sm-8">
                                                <input class="form-control" id="taxiNo" name="taxiNo" type="text" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label">运价类型：</label>
                                            <div class="col-sm-8">
                                                <select class="form-control" id="rateType" name="rateType" >
                                                    <option value="0">未知</option>
                                                    <option value="1">运价1</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label">运营状态：</label>
                                            <div class="col-sm-8">
                                                <select class="form-control" id="vehicleStatus" name="vehicleStatus" >
                                                    <option value="YY"  selected = "selected">运营</option>
                                                    <option value="TC">退出</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label">运输证激活日期：</label>
                                            <div class="col-sm-8">
                                                <input class="form-control" id="taxiRegisterTime" name="taxiRegisterTime" type="text"  readonly/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label">运输证有效日期：</label>
                                            <div class="col-sm-8">
                                                <input class="form-control" id="validTime" name="validTime" type="text"  readonly/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label">运输证失效日期：</label>
                                            <div class="col-sm-8">
                                                <input class="form-control" id="invalidTime" name="invalidTime" type="text"  readonly/>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="tab-pane in" id="deviceTab">
                                <div class="panel margin-top">
                                    <div class="panel-body">
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label">发票打印设备序号：</label>
                                            <div class="col-sm-8">
                                                <input class="form-control" id="deviceSerial" name="deviceSerial" type="text" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label">定位装置品牌：</label>
                                            <div class="col-sm-8">
                                                <input class="form-control" id="deviceBrand" name="deviceBrand" type="text" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label">定位装置型号：</label>
                                            <div class="col-sm-8">
                                                <input class="form-control" id="deviceModel" name="deviceModel" type="text" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label">卫星定位装置IMEI号：</label>
                                            <div class="col-sm-8">
                                                <input class="form-control" id="devicegpsIMEI" name="gpsIMEI" type="text" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label">定位装置安装日期：</label>
                                            <div class="col-sm-8">
                                                <input class="form-control" id="deviceInstallTime" name="deviceInstallTime" type="text" readonly/>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="tab-pane in" id="imageTab">
                                <div class="panel margin-top">
                                    <div class="panel-body">
                                        <div class="col-sm-12" style="text-align: center;">
                                            <a class= "btn btn-info" id="uploadCarImage" >车辆照片上传</a>
                                            <div style="text-align: center;" >
                                                <img id="carImg" src="${ctx}/assets/img/noImg.png"  class="img-responsive img-rounded" style="background-color:#B0B0B0;" alt="请上传车辆45度角彩色照片">
                                                <input type="file" id="picture" name="picture" style="display:none;">
                                                <input type="hidden" id="pictureAddress" name="pictureAddress" style="display:none;">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="tab-pane in" id="plateImageTab">
                                <div class="panel margin-top">
                                    <div class="panel-body">
                                        <div class="col-sm-12" style="text-align: center;">
                                            <a class= "btn btn-info" id="uploadPlateImage" >车牌照片上传</a>
                                            <div style="text-align: center;" >
                                                <img id="plateImg" src="${ctx}/assets/img/noImg.png"  class="img-responsive img-rounded" style="background-color:#B0B0B0;" alt="请上传车牌正面彩色照片">
                                                <input type="file" id="platePicture" name="platePicture" style="display:none;">
                                                <input type="hidden" id="platePictureAddress" name="platePictureAddress" style="display:none;">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-sm-4">
                                </div>
                                <input id="save" type="button" class="btn btn-primary" value="确定">
                                <input type="button" class="btn btn-default" id="close_modal" value="关闭">
                            </div>

                        </div>

                    </form>
                </div>
            </div>
        </div>
    </div>
</div>



<div class="modal fade" id="importCarModal" style="margin-top: 150px;">
    <div class="modal-dialog "><!--modal-lg-->
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title">请选择Excel文件      <span style="margin-left: 20px;color:red;">请先开通车型</span></h4>
            </div>
            <div class="modal-body" style="height:20px;padding:10px 0 30px 0;">
                <div class="col-sm-12" style="height:40px;">
                    <a href="javascript:;" id="downloadTemplet"  url="${ctx}/zhuanche/zhuancheCarTemplate">下载导入模板</a>
                </div>
                <div class="col-sm-12">
                </div>
                <div class = "col-sm-12">
                    <div class="form-group">

                        <input id="carExcel" type="file" name="carExcel" multiple class="file-loading" data-min-file-count="1" data-overwrite-initial="true"><!--data-overwrite-initial="false"  data-min-file-count="2"-->
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <!-- <button type="button" class="btn btn-primary" data-dismiss="modal">关闭</button>-->
                <!--<button type="button" class="btn  btn-default">Save changes</button>-->
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<!--车辆保险-->
<form class="form-horizontal" id="insurance_from" method="post">
    <div class="modal fade" id="car_insurance">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title">添加车辆保险</h4>
                </div>
                <div class="modal-body">
                    <input type="hidden" name="carId" id="car_id">
                    <div class="form-group">
                        <label class="col-sm-4 control-label"><em>*</em>&ensp;保险到期日期：</label>
                        <div class="col-sm-8">
                            <input class="form-control" id="insuranceTime3" name="insuranceEndDate" type="text"  readonly/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label"><em>*</em>&ensp;保险公司：</label>
                        <div class="col-sm-8">
                            <input class="form-control" id="insuranceCompany" name="insuranceCompany" type="text"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label"><em>*</em>&ensp;保险号：</label>
                        <div class="col-sm-8">
                            <input class="form-control" id="insuranceCode" name="insuranceCode" type="text"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label"><em>*</em>&ensp;保险类型：</label>
                        <div class="col-sm-8">
                            <input class="form-control" id="insuranceType" name="insuranceType" type="text"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label"><em>*</em>&ensp;保险金额：</label>
                        <div class="col-sm-8">
                            <input class="form-control" id="insuranceAmount" name="insuranceAmount" type="text"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label"><em>*</em>&ensp;保险生效日期：</label>
                        <div class="col-sm-8">
                            <input class="form-control" id="insValidTime3" name="insuranceValidDate" type="text"  readonly/>
                        </div>
                    </div>

                </div>
                <div class="form-group">
                    <div class="col-sm-5">
                    </div>
                    <button type="button" class="btn btn-primary" id="car_insurance_save">提交</button>
                    <button type="button" class="btn btn-default" id="car_insurance_close">关闭</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>
</form>




<!--修改车辆信息-->
<div class="form-horizontal">
    <div class="modal fade" id="dialog_car_update" data-backdrop="static">
        <div class="modal-dialog" style="width:680px;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="false">&times;</button>
                    <h4 class="modal-title">修改车辆信息</h4>
                </div>
                <div class="modal-body">
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#basicInfo2" data-toggle="tab">基本信息</a></li>
                        <li><a href="#overhaulTab2" data-toggle="tab">年检信息</a></li>
                        <li><a href="#insuranceTab2" data-toggle="tab">保险信息</a></li>
                        <li><a href="#detailedTab2" data-toggle="tab">详细信息</a></li>
                        <li><a href="#taxiTab2" data-toggle="tab">经营信息</a></li>
                        <li><a href="#deviceTab2" data-toggle="tab">定位信息</a></li>
                        <li><a href="#imageTab2" data-toggle="tab">车辆照片</a></li>
                        <li><a href="#plateImageTab2" data-toggle="tab">车牌照片</a></li>
                    </ul>
                    <form id="submit_form_update" action=""  method="post">
                        <div class="tab-content">

                            <div class="tab-pane in active" id="basicInfo2">
                                <div class="panel margin-top">
                                    <div class="panel-body" style="margin-left:0px">

                                        <input type="hidden" id="carId" name="id">
                                        <input type="hidden" id="employId2" name="employId">
                                        <input type="hidden" id="companyName2" name="companyName">
                                        <input type="hidden" id="provincialStr2" name="provincialStr">

										<@shiro.isMainCompany>
                                            <div class="form-group">
                                                <label class="col-sm-3 control-label"><em>*</em>&ensp;所属公司：</label>
                                                <div class="col-sm-9">
                                                    <select class="form-control" id="companyId2" name="companyId">
														<#if companys??>
                                                            <option value="">请选择公司</option>
															<#list companys as company>
                                                                <option value="${company.id}" <#if companyId?? && companyId==company.id>selected="selected"</#if>>${company.abbreviation?if_exists}</option>
															</#list>
														</#if>
                                                    </select>
                                                </div>
                                            </div>
										</@shiro.isMainCompany>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label"><em>*</em>&ensp;车辆名称：</label>
                                            <div class="col-sm-9">
                                                <input id="carName2" name="carName" class="form-control" ></input>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label"><em>*</em>&ensp;车牌号码：</label>
                                            <div class="col-sm-9">
                                                <input id="carNumber2" name="carNumber"  class="form-control" placeholder="如:京A12345"></input>
                                            </div>
                                       </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label"><em>*</em>&ensp;车辆类型：</label>
                                            <div class="col-sm-9">
                                                <select class="form-control" id="carTypeId2" name="carTypeId" >
                                                    <!--<#if carTypes??>
											<#list carTypes as carType>
												<option value="${carType.id}">${carType.typeName?if_exists}<@shiro.isMainCompany>&emsp;&emsp;&emsp;${carType.companyName?if_exists}</@shiro.isMainCompany> </option>
											</#list>
										</#if>-->
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label"><em>*</em>&ensp;行驶公里：</label>
                                            <div class="col-sm-9">
                                                <div class="input-group">
                                                    <input id="drivingDistance2" name="drivingDistance" type="number" class="form-control" >
                                                    <span class="input-group-addon">公里</span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label"><em>*</em>&ensp;车辆状态：</label>
                                            <div class="col-sm-9">
                                                <select class="form-control" id="status" name="status">
                                                    <option value="0">空闲</option>
                                                    <option value="1">忙碌</option>
                                                    <option value="2">离线</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label"><em>*</em>&ensp;是否限行：</label>
                                            <div class="col-sm-9">
                                                <select class="form-control" id="limitLine2" name="limitLine">
                                                    <option value="0">不限行</option>
                                                    <option value="1">星期一</option>
                                                    <option value="2">星期二</option>
                                                    <option value="3">星期三</option>
                                                    <option value="4">星期四</option>
                                                    <option value="5">星期五</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label"><em>*</em>&ensp;购车时间：</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="buyTime2" name="buyTime" type="text"  readonly/>
                                            </div>
                                        </div>
                                         <div class="form-group">
						                 	<label class="col-sm-3 control-label">&ensp;倒班班次：</label>
						                 	<div class="col-sm-9">
						                   		<input id="flights" name="flights" class="form-control" placeholder="如:早，中，晚，白"></input>
						                 	</div>
										</div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">指派员工:</label>
                                            <div id="text_div" class="col-sm-9">
                                                <input class="form-control" id="employName2" name="employName" placeholder="输入:工号、电话、姓名"  type="text"/>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="tab-pane in" id="overhaulTab2">
                                <div class="panel margin-top">
                                    <div class="panel-body">
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label"><em>*</em>下次年检日期：</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="overhaulTime2" name="overhaulTime" type="text"  readonly/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">年度审验状态：</label>
                                            <div class="col-sm-9">
                                                <input type="radio" id="inspectioStatus-0" name="inspectioStatus" value="0" />已审验
                                                <input type="radio" id="inspectioStatus-1" name="inspectioStatus" value="1" />未审验
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">车辆检修状态：</label>
                                            <div class="col-sm-9">
                                                <input type="radio" id="maintenanceStatus-0" name="maintenanceStatus" value="0" />已检修
                                                <input type="radio" id="maintenanceStatus-1" name="maintenanceStatus" value="1" />未检修
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="tab-pane in" id="insuranceTab2">
                                <div class="panel margin-top">
                                    <div class="panel-body">
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label"><em>*</em>&ensp;保险到期日期：</label>
                                            <div class="col-sm-8">
                                                <input class="form-control" id="insuranceTime2" name="insuranceTime" type="text"  readonly/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label">保险公司：</label>
                                            <div class="col-sm-8">
                                                <input class="form-control" id="insurer2" name="insurer" type="text"/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label">保险号：</label>
                                            <div class="col-sm-8">
                                                <input class="form-control" id="insuranceNo2" name="insuranceNo" type="text"/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label">保险类型：</label>
                                            <div class="col-sm-8">
                                                <input class="form-control" id="insType2" name="insType" type="text"/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label">保险金额：</label>
                                            <div class="col-sm-8">
                                                <input class="form-control" id="insMoney2" name="insMoney" type="text"/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label">保险生效日期：</label>
                                            <div class="col-sm-8">
                                                <input class="form-control" id="insValidTime2" name="insValidTime" type="text"  readonly/>
                                            </div>
                                        </div>

                                    </div>
                                </div>
                            </div>

                            <div class="tab-pane in" id="detailedTab2">
                                <div class="panel margin-top">
                                    <div class="panel-body">
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">车牌颜色：</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="plateColor2" name="plateColor" type="text" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">车辆厂牌：</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="brand2" name="brand" type="text" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">车辆类型：</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="vehicleType2" name="vehicleType" type="text" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">车辆型号：</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="vehicleModel2" name="vehicleModel" type="text" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">所属车主：</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="owner2" name="owner" type="text" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">车辆归属：</label>
                                            <div class="col-sm-9">
                                                <select class="form-control" id="driverProType2" name="driverProType" >
                                                    <option value="GR">个人私家车</option>
                                                    <option value="ZY">平台自有车</option>
                                                    <option value="CZ">出租企业</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">车身颜色：</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="bodyColor2" name="bodyColor" type="text" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">发动机号：</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="engineNo2" name="engineNo" type="text" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">车辆识别VIN：</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="vin2" name="vin" type="text" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">燃料类型：</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="fuel2" name="fuel" type="text" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">核定载客：</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="permitted2" name="permitted" type="number" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">车辆注册日期：</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="registrationTime2" name="registrationTime" type="text" readonly/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">车辆排量：</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="displacement2" name="displacement" type="text" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">车辆地址：</label>
                                            <div class="col-sm-3">
                                                <select class="form-control" id="provincial2"   name="provincial2"></select>
                                            </div>
                                            <div class="col-sm-3">
                                                <select class="form-control" id="city2"  name="city2"></select>
                                            </div>
                                            <div class="col-sm-3">
                                                <select class="form-control" id="county2" name="county2"></select>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">详细地址：</label>
                                            <div class="col-sm-9">
                                                <input type="text" class="form-control" id="address2" name="address">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="tab-pane in" id="taxiTab2">
                                <div class="panel margin-top">
                                    <div class="panel-body">
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">发证机构：</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="taxiAgency2" name="taxiAgency" type="text" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">经营区域：</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="taxiRegion2" name="taxiRegion" type="text" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">运输证号：</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="taxiNo2" name="taxiNo" type="text" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">运价类型：</label>
                                            <div class="col-sm-9">
                                                <select class="form-control" id="rateType2" name="rateType" >
                                                    <option value="0">未知</option>
                                                    <option value="1">运价1</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">运营状态：</label>
                                            <div class="col-sm-9">
                                                <select class="form-control" id="vehicleStatus2" name="vehicleStatus" >
                                                    <option value="YY"  selected = "selected">运营</option>
                                                    <option value="TC">退出</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">激活日期：</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="taxiRegisterTime2" name="taxiRegisterTime" type="text"  readonly/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">有效日期：</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="validTime2" name="validTime" type="text"  readonly/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">失效日期：</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="invalidTime2" name="invalidTime" type="text"  readonly/>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="tab-pane in" id="deviceTab2">
                                <div class="panel margin-top">
                                    <div class="panel-body">
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label">发票打印设备序号：</label>
                                            <div class="col-sm-8">
                                                <input class="form-control" id="deviceSerial2" name="deviceSerial" type="text" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label">定位装置品牌：</label>
                                            <div class="col-sm-8">
                                                <input class="form-control" id="deviceBrand2" name="deviceBrand" type="text" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label">定位装置型号：</label>
                                            <div class="col-sm-8">
                                                <input class="form-control" id="deviceModel2" name="deviceModel" type="text" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label">卫星定位装置IMEI号：</label>
                                            <div class="col-sm-8">
                                                <input class="form-control" id="devicegpsIMEI2" name="gpsIMEI" type="text" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label">定位装置安装日期：</label>
                                            <div class="col-sm-8">
                                                <input class="form-control" id="deviceInstallTime2" name="deviceInstallTime" type="text" readonly/>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="tab-pane in" id="imageTab2">
                                <div class="panel margin-top">
                                    <div class="panel-body">
                                        <div class="col-sm-12" style="text-align: center;">
                                            <a class= "btn btn-info" id="uploadCarImage2" >车辆照片上传</a>
                                            <div style="text-align: center;">
                                                <img id="carImg2" src="${ctx}/assets/img/noImg.png"  class="img-responsive img-rounded" style="background-color:#B0B0B0;" alt="请上传车辆45度角彩色照片" onerror="javascript:this.src='${ctx}/assets/img/noImg.png'">
                                                <input type="file" id="picture2" name="picture" style="display:none;">
                                                <input type="hidden" id="pictureAddress2" name="pictureAddress" style="display:none;">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="tab-pane in" id="plateImageTab2">
                                <div class="panel margin-top">
                                    <div class="panel-body">
                                        <div class="col-sm-12" style="text-align: center;">
                                            <a class= "btn btn-info" id="uploadPlateImage2" >车牌照片上传</a>
                                            <div style="text-align: center;">
                                                <img id="plateImg2" src="${ctx}/assets/img/noImg.png"  class="img-responsive img-rounded" style="background-color:#B0B0B0;" alt="请上传车牌正面彩色照片" onerror="javascript:this.src='${ctx}/assets/img/noImg.png'">
                                                <input type="file" id="platePicture2" name="platePicture" style="display:none;">
                                                <input type="hidden" id="platePictureAddress2" name="platePictureAddress" style="display:none;">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-sm-5">
                                </div>
                                <div class="col-sm-3">
                                    <input  type="button" class="btn btn-primary" id="update" value="保存">
                                    <button type="button" class="btn btn-default" id="close_modal_update">取消</button>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" tabindex="-1" id="upCar" role="dialog">
    <div class="modal-dialog modal-sm" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="dataCheck">数据校验中<span  class="loading" style="margin: -60px 0 0 -120px;"></span></h4>
            </div>
            <div class="modal-body">
                <div class="progress" id="progressDiv">
                    <div id="loading" class="progress-bar progress-bar-info progress-bar-striped" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%">
                    </div>
                </div>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<!--上传等待-->
<div class="modal fade" tabindex="-1" id="waitUpCar" role="dialog">
    <div class="modal-dialog modal-sm" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">上传中，请耐心等待……<span  class="loading" style="margin: -60px 0 0 -120px"></span></h4>
            </div>
            <div class="modal-body" style="text-align: center">
                <div class="progress" id="waitDiv">
                    <div id="loading" class="progress-bar progress-bar-info progress-bar-striped" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%">
                    </div>
                </div>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->


</@override>
<@override name="footer">
<script type="text/javascript">
    var isMainCompany=false;
		<@shiro.isMainCompany>
        isMainCompany=true;
		</@shiro.isMainCompany>
</script>
<script src="${ctx}/assets/js/bootstrap-datetimepicker.min.js"></script>
<script src="${ctx}/assets/js/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="${ctx}/assets/js/zhuanche/car.js">
<script src="${ctx}/assets/js/jquery.autocomplete.min.js"></script>
<script src="${ctx}/assets/js/jquery.paging.min.js"></script>
<script src="${ctx}/assets/js/region_select.js"></script>
<script src="${ctx}/assets/js/fileinput.js" type="text/javascript"></script>
<script src="${ctx}/assets/js/fileinput_locale_zh.js" type="text/javascript"></script>
<script src="${ctx}/assets/js/ajaxfileupload.js"></script>
<script type="text/javascript">
	<@jgpt>
	window.jgpt = true;
	</@jgpt>
	window.isUpPlatformInfo = '${isUpPlatformInfo?string('true', 'false')}';
    var thisButton;
    function deleteCar() {
        $.get('${ctx}/zhuanche/deleteCar',{'id':thisButton.attr("data-value")},function(data){
            if(data.success){
                thisButton.parent().parent().remove();
                $.scojs_message('车辆删除成功', $.scojs_message.TYPE_OK);
                setTimeout(function(){
                    window.location.reload(true);
                }, 800);
            } else {
                $.scojs_message(data.message, $.scojs_message.TYPE_ERROR);
            }
        },'json');
    }

    $(document).ready(function(){
    
    
        $("#buyTime").datetimepicker({ format: 'yyyy-mm-dd', language: 'zh-CN', minView: 'month', pickDate: true, pickTime: false, inputMask: false, autoclose: true ,endDate:new Date()});
        $("#buyTime2").datetimepicker({ format: 'yyyy-mm-dd', language: 'zh-CN', minView: 'month', pickDate: true, pickTime: false, inputMask: false, autoclose: true ,endDate:new Date()});
        $("#overhaulTime").datetimepicker({ format: 'yyyy-mm-dd', language: 'zh-CN', minView: 'month', pickDate: true, pickTime: false, inputMask: false, autoclose: true});
        $("#overhaulTime2").datetimepicker({ format: 'yyyy-mm-dd', language: 'zh-CN', minView: 'month', pickDate: true, pickTime: false, inputMask: false, autoclose: true});
        $("#insuranceTime").datetimepicker({ format: 'yyyy-mm-dd', language: 'zh-CN', minView: 'month', pickDate: true, pickTime: false, inputMask: false, autoclose: true});
        $("#insuranceTime2").datetimepicker({ format: 'yyyy-mm-dd', language: 'zh-CN', minView: 'month', pickDate: true, pickTime: false, inputMask: false, autoclose: true});
        $("#insValidTime").datetimepicker({ format: 'yyyy-mm-dd', language: 'zh-CN', minView: 'month', pickDate: true, pickTime: false, inputMask: false, autoclose: true});
        $("#insValidTime2").datetimepicker({ format: 'yyyy-mm-dd', language: 'zh-CN', minView: 'month', pickDate: true, pickTime: false, inputMask: false, autoclose: true});
        $("#registrationTime").datetimepicker({ format: 'yyyy-mm-dd', language: 'zh-CN', minView: 'month', pickDate: true, pickTime: false, inputMask: false, autoclose: true , endDate:new Date()});
        $("#registrationTime2").datetimepicker({ format: 'yyyy-mm-dd', language: 'zh-CN', minView: 'month', pickDate: true, pickTime: false, inputMask: false, autoclose: true , endDate:new Date()});
        $("#taxiRegisterTime").datetimepicker({ format: 'yyyy-mm-dd', language: 'zh-CN', minView: 'month', pickDate: true, pickTime: false, inputMask: false, autoclose: true , endDate:new Date()});
        $("#taxiRegisterTime2").datetimepicker({ format: 'yyyy-mm-dd', language: 'zh-CN', minView: 'month', pickDate: true, pickTime: false, inputMask: false, autoclose: true , endDate:new Date()});
        $("#validTime").datetimepicker({ format: 'yyyy-mm-dd', language: 'zh-CN', minView: 'month', pickDate: true, pickTime: false, inputMask: false, autoclose: true });
        $("#validTime2").datetimepicker({ format: 'yyyy-mm-dd', language: 'zh-CN', minView: 'month', pickDate: true, pickTime: false, inputMask: false, autoclose: true});
        $("#invalidTime").datetimepicker({ format: 'yyyy-mm-dd', language: 'zh-CN', minView: 'month', pickDate: true, pickTime: false, inputMask: false, autoclose: true});
        $("#invalidTime2").datetimepicker({ format: 'yyyy-mm-dd', language: 'zh-CN', minView: 'month', pickDate: true, pickTime: false, inputMask: false, autoclose: true});
        $("#deviceInstallTime").datetimepicker({ format: 'yyyy-mm-dd', language: 'zh-CN', minView: 'month', pickDate: true, pickTime: false, inputMask: false, autoclose: true , endDate:new Date()});
        $("#deviceInstallTime2").datetimepicker({ format: 'yyyy-mm-dd', language: 'zh-CN', minView: 'month', pickDate: true, pickTime: false, inputMask: false, autoclose: true , endDate:new Date()});


        $(document).on("click",".deletethis",function(){
            thisButton = $(this);
            var confirm = $.scojs_confirm({
                content: "你真的要删除该车辆吗？",
                action:deleteCar
            });
            confirm.show();
        });

		<#if isMainCompany=="true">
            $('#employName').AutoComplete({
                'data': "${ctx}/zhuanche/getDriver",
                ajaxDataType: 'json',
                ajaxParams:function(keyword){
                    return {'param':$('#employName').val(),'companyId':$('#companyId').val()};
                },
                'width': 'auto',
                'async': false,
                'listStyle': 'custom',
                'emphasis': false,
                'matchHandler': function(keyword, data){
                    return true;
                },
                'createItemHandler': function(index, data){
                    return "<span>"+data.username+"    "+data.phone+"</span>";
                },
                'afterSelectedHandler': function(data){
                    $('#employName').val(data.username+"    "+data.phone);
                    $('#employId').val(data.id);
                }
            }).AutoComplete('show');
		<#else>
            $('#employName').AutoComplete({
                'data': "${ctx}/zhuanche/getDriver",
                ajaxDataType: 'json',
                ajaxParams:function(keyword){
                    return {'param':$('#employName').val()};
                },
                'width': 'auto',
                'async': false,
                'listStyle': 'custom',
                'emphasis': false,
                'matchHandler': function(keyword, data){
                    return true;
                },
                'createItemHandler': function(index, data){
                    return "<span>"+data.username+"    "+data.phone+"</span>";
                },
                'afterSelectedHandler': function(data){
                    $('#employName').val(data.username+"    "+data.phone);
                    $('#employId').val(data.id);
                }
            }).AutoComplete('show');
		</#if>


        //添加车辆
        $(document).on("click",".addCar",function(){
            $('#dialog_car').modal();
        });

        //公司修改后对应的车辆类型也修改
        $("#companyId").change(function(){
            var company_id=$("#companyId").val();
            $("#companyName").val($("#companyId").find("option:selected").text());
            $("#carTypeId").html("");
            $.get('${ctx}/zhuanche/queryCarTypes',{'companyId':company_id},function(data){
                if(data.success){
                    $(data.carTypes).each(function(index,element){
                        var id=data.carTypes[index].id;
                        var typeName=data.carTypes[index].typeName;
                        var text="<option value="+id+">"+typeName+"</option>";
                        $("#carTypeId").append(text);
                    });
                }else{
                    $.scojs_message(data.message, $.scojs_message.TYPE_ERROR);
                }

            },'json');
        });


        $("#close_modal").click(function(){
            $('#dialog_car').modal("hide");
        });

        //隐藏
        $("#car_insurance_close").click(function(){
            $('#car_insurance').modal("hide");
        });
        //添加车辆保险
        $(document).on("click",".insurancethis",function(){
            $("#insurance_from #car_id").val($(this).attr("data-value"));
            $('#car_insurance').modal();
        });

        //修改车辆
        $(document).on("click",".updatethis",function(){
            var carId=$(this).attr("data-value");
            $("#carId").val(carId);
            $.ajax({
                type: "GET",
                url: "${ctx}/zhuanche/queryCar",
                data: {id:carId},
                dataType: "json",
                success: function(object){
                    var car=object.data;
                    var html = "";
                    for(var i=0;i<object.carTypes.length;i++){
                        html += "<option value='" + object.carTypes[i].id + "'>" + object.carTypes[i].typeName + "</option>";
                    }
                    $('#carTypeId2').html(html);
                    $("#carName2").val(car.carName);
                    $("#companyId2").val(car.companyId);
                    $("#carNumber2").val(car.carNumber);
                    $("#carTypeId2").val(car.carTypeId);
                    $("#drivingDistance2").val(car.drivingDistance);
                    $("#limitLine2").val(car.limitLine);
                    $("#buyTime2").val(object.buyTime);
                    $("#insurer2").val(car.insurer);
                    $("#insuranceNo2").val(car.insuranceNo);
                    $("#insType2").val(car.insType);
                    $("#insMoney2").val(car.insMoney);
                    $("#insValidTime2").val(object.insValidTime);
                    $("#insuranceTime2").val(object.insuranceTime);
                    $("#overhaulTime2").val(object.overhaulTime);
                    $("#employName2").val(car.employName);
                    $("#employId2").val(car.employId);
                    $("#status").val(car.status);
                    $("#plateColor2").val(car.plateColor);
                    $("#brand2").val(car.brand);
                    $("#vehicleType2").val(car.vehicleType);
                    $("#vehicleModel2").val(car.vehicleModel);
                    $("#owner2").val(car.owner);
                    $("#driverProType2").val(car.driverProType);
                    $("#bodyColor2").val(car.bodyColor);
                    $("#engineNo2").val(car.engineNo);
                    $("#vin2").val(car.vin);
                    $("#fuel2").val(car.fuel);
                    $("#permitted2").val(car.permitted);
                    $("#registrationTime2").val(object.registrationTime);
                    if (car.inspectioStatus==1) {
                        $("#inspectioStatus-1").attr("checked","checked");
                    }else {
                        $("#inspectioStatus-0").attr("checked","checked");
                    }
                    if (car.maintenanceStatus==1) {
                        $("#maintenanceStatus-1").attr("checked","checked");
                    }else{
                        $("#maintenanceStatus-0").attr("checked","checked");
                    }
                    $("#rateType2").val(car.rateType);
                    $("#vehicleStatus2").val(car.vehicleStatus);
                    $("#displacement2").val(car.displacement);
                    $("#totalMileage2").val(car.totalMileage);
                    $("#taxiNo2").val(car.taxiNo);
                    $("#taxiAgency2").val(car.taxiAgency);
                    $("#taxiRegion2").val(car.taxiRegion);
                    $("#validTime2").val(object.validTime);
                    $("#invalidTime2").val(object.invalidTime);
                    $("#taxiRegisterTime2").val(object.taxiRegisterTime);
                    $("#deviceSerial2").val(car.deviceSerial);
                    $("#deviceBrand2").val(car.deviceBrand);
                    $("#deviceModel2").val(car.deviceModel);
                    $("#devicegpsIMEI2").val(car.gpsIMEI);
                    $("#deviceInstallTime2").val(object.deviceInstallTime);
                    $("#address2").val(car.address);
                    $("#flights").val(car.flights);
                    
                    $("#carImg2").attr("src","${ctx}/"+car.picture);
             		$("#pictureAddress2").val(car.picture);
             		
                    $("#plateImg2").attr("src","${ctx}/"+car.platePictureAddress);
             		$("#platePictureAddress2").val(car.platePictureAddress);

                    new PCAS('provincial2','city2','county2');

                    $("#provincial2 option").each(function(index,element){
                        if($(element).attr("value")==car.provincial){
                            $(element).attr("selected","selected");
                            $(element).change();
                            return false;
                        }
                    });

                    $("#city2 option").each(function(index,element){
                        if($(element).attr("value")==car.city){
                            $(element).attr("selected","selected");
                            $(element).change();
                            return false;
                        }
                    });

                    $("#county2 option").each(function(index,element){
                        if($(element).attr("value")==car.county){
                            $(element).attr("selected","selected");
                            return false;
                        }
                    });

                }
            });
            $('#dialog_car_update').modal();
        });

        $("#uploadCarImage2").click(function () {
            $("#picture2").click();
        });
       
        $(document).on('change', '#picture2', function () {
            if ($.trim($(this).val())) {
                $.ajaxFileUpload({
                    url: '${ctx}/common/uploadCarImage',
                    secureuri: false,
                    fileElementId: 'picture2',
                    dataType: 'json',
                    data: {upload_img_token: ${upload_img_body_token}},
                    success: function (result) {
                        if (result.success) {
                            $.scojs_message("上传成功", $.scojs_message.TYPE_OK);
                            $("#carImg2").attr("src", "${ctx}/" + result.url);
                            $("#pictureAddress2").val(result.url);
                        }else {
                            $.scojs_message(result.msg, $.scojs_message.TYPE_ERROR);
                        }
                    }
                });
            }

        });
        
         $("#uploadPlateImage2").click(function () {
            $("#platePicture2").click();
        });
        $(document).on('change', '#platePicture2', function () {
            if ($.trim($(this).val())) {
                $.ajaxFileUpload({
                    url: '${ctx}/common/uploadPlateImage',
                    secureuri: false,
                    fileElementId: 'platePicture2',
                    dataType: 'json',
                    data: {upload_img_token: ${upload_img_plate_token}},
                    success: function (result) {
                        if (result.success) {
                            $.scojs_message("上传成功", $.scojs_message.TYPE_OK);
                            $("#plateImg2").attr("src", "${ctx}/" + result.url);
                            $("#platePictureAddress2").val(result.url);
                        }else {
                            $.scojs_message(result.msg, $.scojs_message.TYPE_ERROR);
                        }
                    }
                });
            }

        });

        //公司修改后对应的车辆类型也修改
        $("#companyId2").change(function(){
            var company_id=$("#companyId2").val();
            $("#companyName2").val($("#companyId2").find("option:selected").text());
            $("#carTypeId2").html("");
            $.get('${ctx}/zhuanche/queryCarTypes',{'companyId':company_id},function(data){
                if(data.success){
                    $(data.carTypes).each(function(index,element){
                        var id=data.carTypes[index].id;
                        var typeName=data.carTypes[index].typeName;
                        var text="<option value="+id+">"+typeName+"</option>";
                        $("#carTypeId2").append(text);
                    });
                }else{
                    $.scojs_message(data.message, $.scojs_message.TYPE_ERROR);
                }

            },'json');
        });


        $("#close_modal_update").click(function(){
            $('#dialog_car_update').modal("hide");
        });
        //上传车辆照片
        $("#uploadCarImage").click(function () {
            $("#picture").click();
        });
        $(document).on('change', '#picture', function () {
            if ($.trim($(this).val())) {
                $.ajaxFileUpload({
                    url: '${ctx}/common/uploadCarImage',
                    secureuri: false,
                    fileElementId: 'picture',
                    dataType: 'json',
                    data: {upload_img_token: ${upload_img_body_token}},
                    success: function (result) {
                        if (result.success) {
                            $.scojs_message("上传成功", $.scojs_message.TYPE_OK);
                            $("#carImg").attr("src", "${ctx}/" + result.url);
                            $("#pictureAddress").val(result.url);
                        }else {
                            $.scojs_message(result.msg, $.scojs_message.TYPE_ERROR);
                        }
                    }
                });
            }

        });
        
         //上传车牌照片
        $("#uploadPlateImage").click(function () {
            $("#platePicture").click();
        });
        $(document).on('change', '#platePicture', function () {
            if ($.trim($(this).val())) {
                $.ajaxFileUpload({
                    url: '${ctx}/common/uploadPlateImage',
                    secureuri: false,
                    fileElementId: 'platePicture',
                    dataType: 'json',
                    data: {upload_img_token: ${upload_img_plate_token}},
                    success: function (result) {
                        if (result.success) {
                            $.scojs_message("上传成功", $.scojs_message.TYPE_OK);
                            $("#plateImg").attr("src", "${ctx}/" + result.url);
                            $("#platePictureAddress").val(result.url);
                        }else {
                            $.scojs_message(result.msg, $.scojs_message.TYPE_ERROR);
                        }
                    }
                });
            }

        });
		<#if isMainCompany=="true">
            $('#employName2').AutoComplete({
                'data': "${ctx}/zhuanche/getDriver",
                ajaxDataType: 'json',
                ajaxParams:function(keyword){
                    return {
                        'param':$('#employName2').val(),
                        'companyId':$('#companyId2').val()};
                },
                'width': 'auto',
                'async': false,
                'listStyle': 'custom',
                'emphasis': false,
                'matchHandler': function(keyword, data){
                    return true;
                },
                'createItemHandler': function(index, data){
                    return "<span>"+data.username+"    "+data.phone+"</span>";
                },
                'afterSelectedHandler': function(data){
                    $('#employName2').val(data.username+"    "+data.phone);
                    $('#employId2').val(data.id);
                }
            }).AutoComplete('show');
		<#else>
            $('#employName2').AutoComplete({
                'data': "${ctx}/zhuanche/getDriver",
                ajaxDataType: 'json',
                ajaxParams:function(keyword){
                    return {'param':$('#employName2').val()};
                },
                'width': 'auto',
                'async': false,
                'listStyle': 'custom',
                'emphasis': false,
                'matchHandler': function(keyword, data){
                    return true;
                },
                'createItemHandler': function(index, data){
                    return "<span>"+data.username+"    "+data.phone+"</span>";
                },
                'afterSelectedHandler': function(data){
                    $('#employName2').val(data.username+"    "+data.phone);
                    $('#employId2').val(data.id);
                }
            }).AutoComplete('show');
		</#if>

        //省、市、县
        new PCAS('provincial','city','county');


    });

    <#--//服务机构行政区划代码-->
    <#--var cityopts2 = {-->
        <#--data: districtData,     // districtData为district-all.js中定义的变量-->
        <#--selClass: 'form-control serviceAgenciesNumber_class',-->
        <#--head: '--请选择--',-->
        <#--selStyle: 'margin-top: 3px;',-->
        <#--fixWidth: 150,-->
        <#--defVal: [${company.serviceAgenciesNumberArr?if_exists}],-->
        <#--select:  '#serviceAgenciesNumber_select'-->
    <#--};-->
    <#--var linkageSel2 = new LinkageSel(cityopts2);-->
    <#--linkageSel2.onChange(function() {-->
        <#--var code=this.getSelectedData('code');// 最末选定菜单的zip数据值-->
        <#--$("#serviceAgenciesNumber").val(code);-->
    <#--});-->
    
    function CheckImgExists(imgurl) {
    
	var ImgObj = new Image(); // 判断图片是否存在
	ImgObj.src = imgurl;
	// 没有图片，则返回-1
	if (ImgObj.fileSize > 0 || (ImgObj.width > 0 && ImgObj.height > 0)) {
		return true;
	} else {
		return false;
	}
	
};
</script>
</@override>
<@extends name="../layout.ftl"/>